1. Field of the Invention
The present invention relates generally to a triangular wave generating circuit, and more specifically to a triangular wave generating circuit having synchronization with an external clock.
2. Description of the Related Art
A triangular wave generator is used to generate a triangular wave signal by charging or discharging a capacitor. The triangular wave generator can be used in various applications. One common application is for converting an analog audio signal into a pulse signal in a Class-D power amplifier.
FIG. 1 is a circuit diagram illustrating a prior art circuit 10 for forming a triangular wave VOUT from a square wave signal. The performance of this triangular wave can seriously influence the accuracy of applications that utilize the triangular wave, such as pulse width modulation (PWM) applications. The switching frequency fSW of the output triangular wave is equal to 1/(TU+TD) wherein TU is the period of the rise of the triangular wave from VL to VH and TD is the period of the falling of the triangular wave from VH to VL. The “up” period TU is equal to C*(VH−VL)/IC, where C is the capacitance value of the capacitor C1 across the operational amplifier 12, and IC is the charging current from a current source I1. Similarly, the “down” period TD is equal to C*(VH−VL)/ID, where ID is the discharging current from a current source I2 in FIG. 1. Assuming IC is matched to ID, then the frequency fSW is equal to IC/(2*C*(VH−VL)). From this equation, it is known that the switching frequency of the triangular wave is directly proportional to the charging and discharging currents and inversely proportional to the triangular wave swing.
FIG. 2 illustrates potential problems with the triangular wave generators such as the generator 10 of FIG. 1. For example, as shown in “Problem 1” of FIG. 2, the triangular wave does not vary between the desired peak limits VH and VL if the current sources are not matched, i.e., if current source I2>I1 or current source I1<I2. Similarly, “Problem 2” illustrates that this same issue arises if the square wave signal does not have an ideal duty cycle. The second problem is frequently found when the internal clock pulse is not synchronized to an external clock source. Synchronizing an internal clock to an external clock is important in, for example, multiple class D amplifier applications, such a 5.1 channel or 7.1 channel audio systems. If the switching frequency is not the same, a beat frequency will occur in the audio band.
Therefore, there is a need to provide a circuit to solve the above problems.